﻿// Author: AustralTek 
// Creation date: 2012/05/09
// http://www.australtek.com
// Copyright: 2009 - 2012

/* 
Glossary:
*/

var WREF = {};
WREF.Points = {
    A: {
        X: 0
        , Y: 0
    }
    , B: {
        X: 1000
        , Y: 1000
    }
};

WREF.DrawLine = function DrawLine(points) {
    try {
        var bla = "";
        var lineLength = Math.sqrt((points.A.X-points.B.X)*(points.A.X-points.B.X)+(points.A.Y-points.B.Y)*(points.A.Y-points.B.Y));

        for( var i=0; i<lineLength; i++ )
            bla += "<div style='position:absolute;left:"+ Math.round( points.A.X+(points.B.X-points.A.X)*i/lineLength  ) +"px;top:"+ Math.round( points.A.Y+(points.B.Y-points.A.Y)*i/lineLength  ) +"px;width:1px;height:1px;background:#000'></div>";

        document.body.innerHTML += bla;
    }
    catch(Error) { Common.ShowError(Error); }
};